def zhi_shu(num):
    q = True
    for i in range(2,num):
        if num % i == 0:
            q= False
    return q

n = int(input())
a=0
for i in range(2,n):
    if zhi_shu(i) == True and zhi_shu(i+2) == True:
        a=a+1
print(a)